const TYPE = {
    object: '[object Object]',
    array: '[object Array]',
    number: '[object Number]',
    string: '[object String]',
    boolean: '[object Boolean]',
    null: '[object Null]',
    undefined: '[object Undefined]',
    symbol: '[object Symbol]',
    function: '[object Function]',
    window: '[object Window]',
    document: '[object HTMLDocument]'
};

function getType(v) {
    return Object.prototype.toString.call(v);
}

export function isObject(v) {
    return TYPE.object === getType(v);
}

export function isArray(v) {
    return TYPE.array === getType(v);
}

export function isNumber(v) {
    return TYPE.number === getType(v);
}

export function isNull(v) {
    return TYPE.number === getType(v);
}

export function isBoolean(v) {
    return TYPE.boolean === getType(v);
}

export function isUndefined(v) {
    return TYPE.undefined === getType(v);
}

export function isSymbol(v) {
    return TYPE.symbol === getType(v);
}

export function isFunction(v) {
    return TYPE.function === getType(v);
}

export function isString(v) {
    return TYPE.string === getType(v);
}

export function isWindow(v) {
    return TYPE.window === getType(v);
}

export function isHTMLElement(v) {
    return /^\[object HTML[^\]]*Element\]$/.test(getType(v));
}

export function isDocument(v) {
    return TYPE.document === getType(v);
}